package com.frinder.entity;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Created by kiktech on 2017/5/6.
 */
public class Response {

    public static final Response SUCCESS = new Response(Code.SUCCESS, Code.SUCCESS.message);

    public static final Response FAIL = new Response(Code.FAIL, Code.FAIL.message);

    public Response() {
    }

    public Response(Code code, String message) {
        this.code = code;
        this.message = message;
    }

    private Code code;

    private String message;

    public enum Code {

        SUCCESS("成功"), FAIL("失败");

        private String message;

        Code(String message) {
            this.message = message;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    public Code getCode() {
        return code;
    }

    public void setCode(Code code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
    }
}
